package com.xia.controller.result;

/**
 * 结果类
 */

public class Result {

    /**
     * 状态码
     */
    private ResultCode code;
    /**
     * 提示信息
     */
    private String message;
    /**
     * 数据
     */
    private Object data;

    /**
     *  code：状态码
     *  message：提示信息
     *  data：数据
     */
    public Result(ResultCode code, String message, Object data) {
        this.code = code;
        this.data = data;
        this.message = message;
    }

    /**
     *  code：状态码
     *  message：提示信息
     */
    public Result(ResultCode code, String message) {
        this.code = code;
        this.message = message;
    }

    public ResultCode getCode() {
        return code;
    }

    public void setCode(ResultCode code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "Result{" +
                "code='" + code + '\'' +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }
}
